<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>个人中心- 学生</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../layuiadmin/layui/css/layui.css" th:href="@{static/layuiadmin/layui/css/layui.css}" media="all">
  <link rel="stylesheet" href="../layuiadmin/style/admin.css" th:href="@{static/layuiadmin/style/admin.css}" media="all">
  <script src="../js/jquery-1.9.1.min.js" th:src="@{static/js/jquery-1.9.1.min.js}"></script>  
  <script>
 // /^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');a
  $(document).ready(function(){
  		//Enter键提交搜索关键字事件
    	$(document).keypress(function(event){
	  		if(event.keyCode=="13"){
	  			$("#item-search").click();
	  		}
	  		
	  	});
    	//搜索按钮点击事件
    	$("#item-search").click(function(){
    		console.log("进入search");
    		var keyword = $('input[class="layui-input layui-input-search"]').val();
    		if(keyword == ""){
    			layer.msg("搜索不能为空！");
    			return false;
    		}
    		sessionStorage.setItem('keyword',keyword);
    		console.log(keyword);
    		window.location.href="toShop?haskey=1";
    	});
    	
    	
  })
      setInterval("test()",5000);
    function test(){
/*     	var flag = $("#xiaoyuandian").attr("class") */
/*     	if (flag == "layui-badge-dot") { */
//  		$.ajax({
//	    		type:"get",
//	    		async:true,
//	    		url:"/count",
//	    		success:function(e){
//	    			if(e == 'true'){
//	/*     				alert(e); */
//	    				$("#xiaoyuandian").addClass("layui-badge-dot")
//	    			}else{
//	    				$("#xiaoyuandian").removeClass("layui-badge-dot")
//	/*     				alert(1); */
//	    			}
//	    		}
//	    	})
/* 		}else{ */
			$.ajax({
	    		type:"get",
	    		async:true,
	    		url:"/count",
	    		success:function(e){
	    			if(e == 'true'){
/* 	    				alert(1); */
	/*     				alert(e); */
	    				$("#xiaoyuandian").addClass("layui-badge-dot")
	    			}else{
/* 	    				alert(2); */
	    				$("#xiaoyuandian").removeClass("layui-badge-dot")
	/*     				alert(1); */
	    			}
	    		}
	    	})
/* 		} */
    }
    $(function(){
    	$('#xiaoxi').click(function(){
/*     		alert(1); */
    		$("#xiaoyuandian").removeClass("layui-badge-dot")
    	})
    	
    })
  </script>
</head>
<body class="layui-layout-body">
  
  <div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
      <div class="layui-header">
        <!-- 头部区域 -->
        <ul class="layui-nav layui-layout-left">
          <li class="layui-nav-item layadmin-flexible" lay-unselect>
            <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
              <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
            </a>
          </li>
          <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="tohome"  title="首页">
              <i class="layui-icon layui-icon-website"></i>
            </a>
          </li>
          <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;" layadmin-event="refresh" title="刷新">
              <i class="layui-icon layui-icon-refresh-3"></i>
            </a>
          </li>
          <li class="layui-nav-item layui-hide-xs" style="margin-right: 5px;" lay-unselect>
            <input type="text" placeholder="搜索..." class="layui-input layui-input-search">
          </li>
          <li class="layui-nav-item" style="margin-left: 0px;" lay-unselect>
          	<button type="button" id="item-search" class="layui-btn layui-btn-sm layui-btn-normal">
							<i class="layui-icon layui-icon-search"></i>
							搜索
						</button>
          </li>
        </ul>
        <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
          <li class="layui-nav-item" id="xiaoxi">
            <a  lay-text="消息中心" href="/tonews" th:href="@{/tonews}" target="_blank">
              <i class="layui-icon layui-icon-notice"></i>
              <!-- 如果有新消息，则显示小圆点 -->
              <span class="" id="xiaoyuandian"></span>
            </a>
          </li>
          
          <li class="layui-nav-item" lay-unselect>
            <a href="toShop" target="_blank" layadmin-event="message" lay-text="商城" title="商城">
              <i class="layui-icon layui-icon-cart"></i>  
              
              <!-- 如果有新消息，则显示小圆点 -->
              <!--<span class="layui-badge-dot"></span>-->
            </a>
          </li>
          <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event="theme" title="主题">
              <i class="layui-icon layui-icon-theme"></i>
            </a>
          </li>

          <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;">
              <cite th:text="${session.name}"></cite>
            </a>
            <dl class="layui-nav-child">
              <dd><a lay-href="toBaseInfo">基本资料</a></dd>
              <dd><a lay-href="toChangePassword">修改密码</a></dd>
              <hr>
              <dd  style="text-align: center;"><a href="logout">退出</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event="fullscreen">
              <i class="layui-icon layui-icon-screen-full"></i>
            </a>
          </li>
          <!--<li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event=""><i class="layui-icon layui-icon-more-vertical"></i></a>
          </li>-->

        </ul>
      </div>
      
      <!-- 侧边菜单 -->
      <div class="layui-side layui-side-menu">
        <div class="layui-side-scroll">
          <div class="layui-logo" lay-href="home/console.html">
            <span th:text="${session.name}"></span>
          </div>
          
          <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
            <li data-name="news" class="layui-nav-item layui-nav-itemed">
              <a lay-href="tonews" lay-tips="消息中心" lay-direction="2">
                <i class="layui-icon layui-icon-notice" ></i>
                <cite>消息中心</cite>
              </a>
            </li>
            <li data-name="home" class="layui-nav-item layui-nav-itemed">
              <a lay-href="toMyExam" lay-tips="我的考试" lay-direction="2">
                <i class="layui-icon layui-icon-file" ></i>
                <cite>我的考试</cite>
              </a>
            </li>
            <li data-name="home" class="layui-nav-item layui-nav-itemed">
              <a lay-href="toentrance" lay-tips="考试入口" lay-direction="2">
                <i class="layui-icon layui-icon-edit" ></i>
                <cite>考试入口</cite>
              </a>
            </li>
            
            <li data-name="home" class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;" lay-tips="个人资料" lay-direction="2">
                  <i class="layui-icon layui-icon-home"></i>
                  <cite>个人资料</cite>
                </a>
                <dl class="layui-nav-child">
                
                  <dd data-name="console">
                    <a lay-href="toBaseInfo">基本信息</a>
                  </dd>
                  <dd data-name="console">
                    <a lay-href="toChangePassword">修改密码</a>
                  </dd>
                </dl>
              </li>
                 
            <li data-name="home" class="layui-nav-item layui-nav-itemed">
              <a lay-href="toStuOrder" lay-tips="购买记录" lay-direction="2">
                <i class="layui-icon layui-icon-cart"></i>
                <cite>购买记录</cite>
              </a>
             
            </li>
           
           
         
          
      
          </ul>
        </div>
      </div>

      <!-- 页面标签 -->
      <div class="layadmin-pagetabs" id="LAY_app_tabs">
        <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-down">
          <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
            <li class="layui-nav-item" lay-unselect>
              <a href="javascript:;"></a>
              <dl class="layui-nav-child layui-anim-fadein">
                <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
              </dl>
            </li>
          </ul>
        </div>
        <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
          <ul class="layui-tab-title" id="LAY_app_tabsheader">
            <li lay-id="home/console.html" lay-attr="home/console.html" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
          </ul>
        </div>
      </div>
      
      
      <!-- 主体内容 -->
      <div class="layui-body" id="LAY_app_body">
        <div class="layadmin-tabsbody-item layui-show">
          <iframe src="tohomeStu" frameborder="0" class="layadmin-iframe"></iframe>
        </div>
      </div>
      
      <!-- 辅助元素，一般用于移动设备下遮罩 -->
      <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
  </div>

<script src="../layuiadmin/layui/layui.js"  th:src="@{static/layuiadmin/layui/layui.js}"></script>
  <script>
  layui.config({
    base: '/static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use('index');
  </script>
  
</body>
</html>


